<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="css/base.css"/>
    <link rel="stylesheet" href="css/index.css"/>
    <link rel="stylesheet" href="css/login.css"/>
    <link rel="stylesheet" type="text/css" href="css/Style.css" media="all" /><!--页面整体样式-->
    <script src="js/jquery-1.7.2.js"></script>

    <script type="text/javascript">
        var url=location.search;
        var Request = new Object();
        if(url.indexOf("?")!=-1){
            var str = url.substr(1)　//去掉?号
            strs = str.split("&");
            for(var i=0;i<strs.length;i++){
                Request[strs[i ].split("=")[0]]=unescape(strs[i].split("=")[1]);
            }
        }
        var email = Request["email"];
        $(function(){

            $("#user").val(email);
            $("#next").click(function(){
                var user=$("#user").val();
                var email=$("#email").val();
                if(user.length<1){
                    alert("登录名不能为空")
                    return false;
                }else if(email.length<1){
                    alert("邮箱不能为空")
                    return false;
                }else if(!email.match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)){
                alert("邮箱格式错误")
                    return false;
                }
            }).mousedown(function(){
                $("#next").addClass("l_anniu")
            }).mouseout(function(){
                $("#next").removeClass("l_anniu")
            });


        });
        function Save() {

            $.ajax({
                url: "../user/pwdreset.do",
                async: false,
                type: "post",
                dataType: "json",
                data: {"username": "" + email + ""/*, "codes": "" + codes + ""*/},

                success: function (data) {

                    if (data.success == false) {
                        alert("邮件发送失败")
                    } else {
                        alert("邮件发送成功")
                    }
                }
            });
        }

    </script>
</head>
<body>
<div id="header">

</div>
<div class="l_top">
</div>
<div class="l_content">
    <div class="l_input">
        <p class="l_title">找回密码</p>
        <p class="l_bai"></p>
        <form class="l_form">
            <span class="l_get" >找回方式 : </span><p><input type="text" name=""  readonly="readonly"   value="邮箱" /><em></em></p>
            <span class="l_login">登录名 :</span><p><input  readonly="readonly" type="text" id="user"  name="" /><em></em></p>
        <!--    <span class="l_get" >邮箱地址 : </span><p><input  type="text" id="email" name="email" /><em></em></p>-->
            <div class="l_button top10"><a href="success.html"><input onclick="Save()" style="cursor: pointer" id="next" type="button" value="下 一 步"  /></a></div>
        </form>

    </div>
</div>



<div class="gContent4"></div>
<script>
    $.ajax({
        url:"x1Header.html",
        async:false,
        success:function(html){
            $("#header").append(html);
        }
    })
</script>
<script>
    $.ajax({
        url:"x2Footer.html",
        async:false,
        success:function(html){
            $(".gContent4").append(html);
        }
    })
</script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/roundabout.js" ></script>
<script type="text/javascript" src="js/roundabout_shapes.js" ></script>
<script type="text/javascript" src="js/gallery_init.js" ></script>
</body>
</html>














